import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/views/Layout'

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      { path: '/', component: () => import('@/views/Home') },
      { path: '/category/:id', component: () => import('@/views/category') },
      { path: '/product/:id', component: () => import('@/views/Goods') },
      { path: '/cart', component: () => import('@/views/cart') },
      { path: '/Settlement', component: () => import('@/views/Settlement') },
      // 测试
      { path: '/cese', component: () => import('@/views/cese') }

    ]
  },
  { path: '/login', component: () => import('@/views/login') },
  { path: '/login/callback', component: () => import('@/views/login/callback') }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
